<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form CActiveForm */

$this->pageTitle=Yii::app()->name . ' - Contact Us';
?>

<?php if(Yii::app()->user->hasFlash('contact')): ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr class="texteSimple">
          <td><a href="<?php echo Yii::app()->request->baseUrl; ?>" class="texteSimple">
          <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icon-backpage.png" width="22" height="19" border="0" align="bottom">&nbsp;&nbsp;&nbsp;<?php echo Yii::t('main','home-return');?></a>
            <hr noshade width="100%" color="#CCCCCC" size="1" ></td>
        </tr>
        <tr>
          <td class="titresIndex"><p align="center"><?php echo Yii::t('main','location-suggest');?></p>
          <p class="ficheTypeLieu"><?php echo Yii::app()->user->getFlash('contact'); ?></p></td>
        </tr>        
        <tr>
          <td align="center">&nbsp;</td>
        </tr>
      </table>	
<?php else: ?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'contact-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>

 <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr class="texteSimple">
          <td><a href="<?php echo Yii::app()->request->baseUrl; ?>" class="texteSimple">
          <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icon-backpage.png" width="22" height="19" border="0" align="bottom">&nbsp;&nbsp;&nbsp;<?php echo Yii::t('main','home-return');?></a>
            <hr noshade width="100%" color="#CCCCCC" size="1" ></td>
        </tr>
        <tr>
          <td align="center" class="titresIndex"><?php echo Yii::t('main','location-suggest');?></td>
        </tr>
        <tr>
          <td><p class="ficheServicesTitres"><br>
           <?php echo Yii::t('main','contact-join-text');?></p>
            <table width="100%" border="0" cellpadding="0" cellspacing="5" id="tableFicheMini">
            <tr>
              <td width="199" align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'name'); ?></td>
              <td width="571" align="left" valign="middle" class="texteSimple">
              <?php echo $form->textField($model,'name',array('size'=>28)); ?>
				<?php echo $form->error($model,'name'); ?>
              <td width="20" align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td width="189" valign="middle" class="ficheZipCodeLieu">&nbsp;</td>
            </tr>
            <tr>
              <td align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'email'); ?></td>
              <td align="left" valign="middle" class="texteSimple"><label for="askMailAddress"></label>
              <?php echo $form->textField($model,'email',array('size'=>28)); ?>
				<?php echo $form->error($model,'email'); ?>(<?php echo Yii::t('main','contact-join-email');?>)</td>
              <td align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td valign="middle" class="ficheZipCodeLieu">&nbsp;</td>
            </tr>
            <tr>
              <td align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'tel'); ?></td>
              <td align="left" valign="middle" class="texteSimple"></label>
                <?php echo $form->textField($model,'tel',array('size'=>28)); ?>
                (<?php echo Yii::t('main','contact-join-tel');?>)</td>
              <td align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td valign="middle" class="ficheZipCodeLieu">&nbsp;</td>
            </tr>
            <tr>
              <td align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'type'); ?> </td>
              <td align="left" valign="middle" class="texteSimple">
              <?php echo $form->dropDownList($model, 'type',CHtml::listData(Type::model()->findAll(),'id','name'),array('id'=>'nature','class'=>'texteSimple','prompt'=>'Nature du lieu...',));?>
               </td>
              <td align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td valign="middle" class="ficheZipCodeLieu">&nbsp;</td>
            </tr>
            <tr>
              <td align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'department'); ?> </td>
              <td align="left" valign="middle" class="texteSimple"><label for="askPeople"></label>
               <?php echo $form->dropDownList($model,'department',CHtml::listData(Department::model()->findAll(array('order' => 'name')),'id','name'),array('id'=>'departements','class'=>'texteSimple','prompt'=>'Départements de ...',));?>
              </td>
              <td align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td valign="middle" class="ficheZipCodeLieu">&nbsp;</td>
            </tr>
            <tr>
              <td align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'site'); ?> </td>
              <td align="left" valign="middle" class="texteSimple">
             	<?php echo $form->textField($model,'site',array('size'=>28)); ?>
                (<?php echo Yii::t('main','contact-join-site');?>)</td>
              <td align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td valign="middle" class="ficheZipCodeLieu">&nbsp;</td>
            </tr>
            <tr>
              <td align="right" valign="middle" class="texteSimple"><?php echo $form->labelEx($model,'body'); ?> </td>
              <td align="left" valign="middle" class="texteSimple">
               <?php echo $form->textArea($model,'body',array('rows'=>8, 'cols'=>50)); ?>
				<?php echo $form->error($model,'body'); ?>
			  </td>
              <td align="center" valign="middle" class="ficheTypeLieu">&nbsp;</td>
              <td valign="middle" class="ficheZipCodeLieu">
              <?php echo CHtml::imageButton(Yii::app()->request->baseUrl.'/images/bt-send.png',array("width"=>"62", "height"=>"23", "border"=>"0")); ?>              
              </td>
            </tr>
          </table></td>
        </tr>
        <tr>
        </tr>
        <tr>
          <td align="center">&nbsp;</td>
        </tr>
      </table>
<?php $this->endWidget(); ?>
</div><!-- form -->
<?php endif; ?>